require("../../assets/css/basic.less");
require("../../assets/css/normalize.css");
require("../../assets/css/property.css");
require("../../assets/css/reset.css");
require("../../assets/fonts/font-icon/iconfont.css");
require("../user/user.less");
require("weui");
const weui = require("weui.js");
const dom = require("../../libs/dom.js");
const utils = require("../../libs/utils");
const axios = require("../../libs/axios.js");

document.addEventListener("DOMContentLoaded", function () {
	//显示个人信息
	axios.get("/api/user/info").then((res) => {
		let data = res.data.data;
		console.log(data);
		dom.get("#avator").src = axios.defaults.baseURL + data.imgUrl;
		dom.get("#nickname").textContent = data.nickName;
		dom.get("#sign").textContent = data.sign;
	});

	// 退出登录
	document.querySelector("#btnOut").addEventListener("click", function () {
		weui.confirm("是否确定退出登录？", function () {
			localStorage.clear();
			location.href = "./login.html";
		});
	});

	// 显示页脚
	utils.footerPlugin(3);
});
